function updata(resoult){
    let admins=[];
    resoult.forEach(item=>{
        let obj={
            province:item.province,
            active_value:item.active_value
        }
        console.log(obj);
        let sta = false
        admins.forEach(res=>{
            if(res.province == item.province){
                sta = true
                res.active_value+=item.active_value
            }
        })
        if(sta == false){
          admins.push(obj)
         
        } 

     })
     return admins
}


function updata1(resoult){
    let admins=[];
    resoult.forEach(item=>{
        let obj={
            province:item.province,
            city:item.city,
            active_value:item.active_value
        }
        console.log(obj);
        let sta = false
        admins.forEach(res=>{
            if(res.province == item.province&&res.city==item.city){
                sta = true
                res.active_value+=item.active_value
            }
        })
        if(sta == false){
          admins.push(obj)
         
        } 

     })
     return admins
}

function areaData(resoult){
    let admins=[];
    resoult.forEach(item=>{
        let obj={
            province:item.province,
            city:item.city,
            area:item.area,
            active_value:item.active_value
        }
        console.log(obj);
        let sta = false
        admins.forEach(res=>{
            if(res.province == item.province&&res.city==item.city&&res.area==item.area){
                sta = true
                res.active_value+=item.active_value
            }
        })
        if(sta == false){
          admins.push(obj)
         
        } 

     })
     return admins
}



module.exports={updata,updata1,areaData}